#ifndef MODULES_MINIMP3_MINIMP3SERVICE_H_
#define MODULES_MINIMP3_MINIMP3SERVICE_H_
#include "../core/IBean.h"
#include <HardwareSerial.h>

enum MimiMp3EQ {
	Normal, Pop, Rock, Jazz, Classic, Bass
};
enum MIMIMP3_CMD {
	NEXT = 0x1,
	PRE = 0x2,
	PLAY = 0x3,
	VOLUME= 0x6,
	EQ = 0x7,
 	START = 0x0D,
	PAUSE = 0x0E,
	STOP = 0x16,
	RANDOM = 0x18,
	LOOP = 0x19,
};
class MiniMp3Service: public IBean {
private:
	HardwareSerial *serial;
	long lastSend;
public:
	void prepare0();
	void close();

	void play(uint16_t num);
	void stopMusic();
	void startMusic();
	void pauseMusic();
 	//0-30 22 以上才听到。。
	void setVolume(uint8_t value);
	void setEQ(MimiMp3EQ value);
	//@parm cmd @link MIMIMP3_CMD
	void send(uint8_t cmd, uint16_t body=0);
	size_t decodePacket(uint8_t *packet,size_t recount ) ;
};
#endif /* MODULES_MINIMP3_MINIMP3SERVICE_H_ */
